<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="author"/>
    <title>Document</title>
    <style>
        div{
            margin:0 auto;
            width: 500px;
        }
        #jumpTo{
            color: red;
            font-size: 30px;
        }
    </style>
	<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
</head>

<body>
    <div>
        <h2>恭喜您，支付成功</h2>
        <span id="jumpTo">10</span>秒后自动返回首页
        <p><button>立即返回</button></p>
    </div>
    <script>
		let time = 10;
		setInterval(function(){
			if(--time == 0)
				location.href = 'https://www.baidu.com';
			document.getElementById('jumpTo').innerText = time;
		},1000);
		
		$('button').click(() =>{
			location.href = "https://www.baidu.com";
		});
</script>
    </script> 
</body>

</html>